package com.clotingshoppos.common.util;

import java.sql.Timestamp;

/**
 * @ClassName: TimeSplit
 * @Description: 分割时间范围
 * @Author: Izzat
 * @Date: 2019-05-19 14:29
 * @Version: v1.0
 */
public class TimeSplit {
    public static Timestamp[] execute(String timeSpan){
        //分割字符串
        String[] time = timeSpan.split(" ");
        time[0] = time[0] + " 00:00:00";
        time[1] = time[1] + " 23:59:59";

        //定义时间戳数组
        Timestamp[] timestamps = new Timestamp[2];
        timestamps[0] = Timestamp.valueOf(time[0]);
        timestamps[1] = Timestamp.valueOf(time[1]);

        return timestamps;
    }
}
